#!/bin/bash

# Prepend the GPL v3 header to the provided
# list of files.

if [ ! -f LICENSE_HEADER ]
then
  echo "I need the LICENSE_HEADER file."
  exit 1
fi

if [ $# -lt 1 ]
then
  echo "Expected at least one file to process."
  exit 1
fi

files=$*

for file in $files
do
  \mv $file $file.old;
  cat LICENSE_HEADER $file.old > $file;
  \rm -f $file.old
  echo "-> GPLized $file"
done

